# 确保运行 `pod lib lint oneCommonLib.podspec` 以验证此 spec 文件的有效性
#
# 以 # 开头的行是可选的，但建议使用
# 要了解更多关于 Podspec 的信息，请参阅 https://guides.cocoapods.org/syntax/podspec.html
#

# 定义新的 Pod 规范
Pod::Spec.new do |s|

  # 指定 Pod 的名称
  s.name             = 'oneCommonLib'
  # 指定 Pod 的版本
  s.version          = '0.1.3'
  # 提供 Pod 的简短描述
  s.summary          = '简短描述'

  # 提供 Pod 的详细描述
  s.description      = '详细描述'

  # 指定 Pod 的主页
  s.homepage         = 'https://github.com/Cansing/oneCommonLib'
  # 可选：指定截图 URL
  # s.screenshots    = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  # 指定 Pod 的许可证
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  # 指定 Pod 的作者
  s.author           = { 'Cansing' => 'Cansing@163.com' }
  # 指定 Pod 的源代码位置
  s.source           = { :git => 'https://gitee.com/cansng/oneCommonLib.git', :tag => s.version.to_s }
  # 可选：指定社交媒体 URL
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  # 指定支持的 iOS 最低版本
  s.ios.deployment_target = '12.0'

  # 定义 'Tools' 子规范
  s.subspec 'Tools' do |ss|
    # ss.source_files = 'oneCommonLib/Tools/*.{h,m}'
     
    # 定义 'Header' 子规范
    ss.subspec 'Header' do |sss|
      sss.source_files = 'oneCommonLib/Tools/Header/*.{h,m}'
    end

    # 定义 'NSObject' 子规范
    ss.subspec 'NSObject' do |sss|
      sss.source_files = 'oneCommonLib/Tools/NSObject/**/*.{h,m}'      
    end

    # 定义 'OneService' 子规范
    ss.subspec 'OneService' do |sss|
      sss.source_files = 'oneCommonLib/Tools/OneService/**/*.{h,m}'   
      sss.dependency 'oneCommonLib/Tools/PPNetworkHelper'
      sss.dependency 'oneCommonLib/Tools/Header'
    end

    # 定义 'PPNetworkHelper' 子规范
    ss.subspec 'PPNetworkHelper' do |sss|
      sss.source_files = 'oneCommonLib/Tools/PPNetworkHelper/**/*.{h,m}'      
    end

    # 定义 'YBPopupMenu' 子规范
    ss.subspec 'YBPopupMenu' do |sss|
      sss.source_files = 'oneCommonLib/Tools/YBPopupMenu/**/*.{h,m}'
      sss.dependency 'oneCommonLib/Tools/Header'
    end

    # 定义 'RobotSystem' 子规范
    ss.subspec 'RobotSystem' do |sss|
      sss.source_files = 'oneCommonLib/Tools/RobotSystem/**/*.{h,m}'
      sss.dependency 'oneCommonLib/Tools/Header'
    end

    # 定义 'SYTimer' 子规范
    ss.subspec 'SYTimer' do |sss|
      sss.source_files = 'oneCommonLib/Tools/SYTimer/**/*.{h,m}'      
    end

    # 定义 'UIButton' 子规范
    ss.subspec 'UIButton' do |sss|
      sss.source_files = 'oneCommonLib/Tools/UIButton/**/*.{h,m}'     
      sss.dependency 'oneCommonLib/Tools/Header' 
      sss.dependency 'oneCommonLib/Tools/UIViewCategory'    
    end

    # 定义 'UIViewCategory' 子规范
    ss.subspec 'UIViewCategory' do |sss|
      sss.source_files = 'oneCommonLib/Tools/UIViewCategory/**/*.{h,m}'   
      sss.dependency 'oneCommonLib/Tools/Header'   
    end

    # 定义 'YJH_MyProgressHUD' 子规范
    ss.subspec 'YJH_MyProgressHUD' do |sss|
      sss.source_files = 'oneCommonLib/Tools/YJH_MyProgressHUD/**/*.{h,m}'
      
      # 可选：定义资源包
      # sss.resource_bundles = {
      #   'YJH_MyProgressHUD' => ['oneCommonLib/Tools/YJH_MyProgressHUD/*.{xib,json,html,jpg,gif,png,xcassets,plist,bundle,geojson}']
      # }
    end
  end

  # 定义 'UserManager' 子规范
  s.subspec 'UserManager' do |ss|
    # ss.source_files = 'oneCommonLib/UserManager/*.{h,m}'
    # 指定依赖
    ss.dependency 'oneCommonLib/Tools/NSObject'

    # 定义 'clientService' 子规范
    ss.subspec 'clientService' do |sss|
      sss.source_files = 'oneCommonLib/UserManager/clientService/**/*.{h,m}'     
      sss.dependency 'oneCommonLib/Tools/OneService'
      sss.dependency 'oneCommonLib/UserManager/MSUserManager'
    end

    # 定义 'MSUserManager' 子规范
    ss.subspec 'MSUserManager' do |sss|
      sss.source_files = 'oneCommonLib/UserManager/MSUserManager/**/*.{h,m}'  
      sss.dependency 'oneCommonLib/UserManager/model'   
    end

    # 定义 'model' 子规范
    ss.subspec 'model' do |sss|
      sss.source_files = 'oneCommonLib/UserManager/model/**/*.{h,m}'     
    end
  end

  # 定义资源包
  s.resource_bundles = {
    'oneCommonLib' => ['oneCommonLib/**/*.{xib,json,html,jpg,gif,png,xcassets,plist,bundle,geojson}']
  }

  # 可选：指定为静态框架
  # s.static_framework = true

  # 指定依赖
  s.dependency 'EasyNavigation'
  s.dependency 'YYKit'
  s.dependency 'AFNetworking'
  s.dependency 'Masonry'
  s.dependency 'MJExtension'

  # s.user_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' }
  # 设置用户目标的 Xcode 配置
  s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
  # 设置 Pod 目标的 Xcode 配置
  s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64', 'VALID_ARCHS' => 'arm64 armv7 x86_64' }

end
